package ntu.sna;

class MyNode {

	static int vertexCount = 0; 
	int id;
	private int remainLife, givenLife;
	
	// constructor without assigning id
	public MyNode(){
		this.id = vertexCount++;
		this.remainLife = LifeGenerator.gen();
		this.givenLife = remainLife;
	}
	
	// constructor with assigning id
	public MyNode(int id){
		this.id =id;
		this.remainLife = LifeGenerator.gen();
		this.givenLife = remainLife;
	}
	
	public int getRemainLife() {
		return remainLife;
	}
	
	public int getGivenLife(){
		return givenLife;
	}

	public void setRemainLife(int life) {
		this.remainLife = life;
	}
	
	public String toString(){
		return "V"+id;
	}
}